package test.ttry;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import y_ut.dbtools.exp.DBDataExport;
import y_ut.dbtools.exp.ExpCsvZipWriter;

public class test2 {

	public static void main(String[] args) throws SQLException {
		//Connection conn = connectSQL("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@127.0.0.1:1521:KMSDB", "kms", "123456");//连接数据库
		
		DBDataExport exp = new DBDataExport("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@127.0.0.1:1521:WEBOFFICEDB", "weboffice", "123456", "WEBOFFICE");
		exp.export(new ExpCsvZipWriter("E:/db-export/db4.zip"));

	}
	
	public static void trac(Object [] obj){
		for (int i = 0; i < obj.length; i++) {
			System.out.print(obj[i]);
			System.out.print("\t");
		}
		System.out.println();
	}
	public static Connection connectSQL(String driver,String url,String UserName,String Password){
		try{
			Class.forName(driver).newInstance();
			return DriverManager.getConnection(url, UserName, Password);
		}catch(Exception e){
			e.printStackTrace();
		}
		return null;
	}

}
